package com.dwaynema.service.impl;

import com.dwaynema.dao.ArticleMapper;
import com.dwaynema.dto.ArticleDto;
import com.dwaynema.entity.Article;
import com.dwaynema.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    ArticleMapper articleMapper;

    @Override
    public Integer addArticle(Article article) {
        return articleMapper.addArticle(article);
    }

    @Override
    public List<ArticleDto> getArticles() {
        return articleMapper.getArticles();
    }

    @Override
    public ArticleDto getArticleById(Integer id){
        return articleMapper.getArticleById(id);
    }

}
